﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DesignPatternDemoCApp.Behavioral.ObserverPattern
{
    /// <summary>
    /// 抽象被观察者对象：被观察者角色
    /// 声明了添加、删除、通知观察者方法
    /// </summary>
    public abstract class AbstractSubject
    {
        /// <summary>
        /// 添加观察者
        /// </summary>
        /// <param name="o"></param>
        public abstract void registerObserver(AbstractObserver o);
        /// <summary>
        /// 删除观察者
        /// </summary>
        /// <param name="o"></param>
        public abstract void removeObserver(AbstractObserver o);
        /// <summary>
        /// 通知观察者
        /// </summary>
        public abstract void notifyObserver(string s);
    }
}
